home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_0493.zip / DOSWINDO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-15  |  2KB  |  56 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 453 of 473
  3. From : Tim Phillips                        1:370/20.0           13 Apr 93  22:03
  4. To   : Sean Palmer
  5. Subj : Dos Windows...
  6. ────────────────────────────────────────────────────────────────────────────────
  7. ->  TP> Awhile back someone was asking about a DOS window... I dunno if
  8. ->  TP> that was ever answered, but you can create a simple DOS window b
  9. ->  TP> a SETINTVEC command and interrupt $29.  If this is above you, le
  10. ->  TP> know, I can write code.
  11. ->
  12. -> WHAT??? Post away!
  13. -> I'm clueless.
  14.  
  15. Ahh, ok, well, this is from nothing but my head, so I don't guarantee it
  16. to be flawless, but here goes (oh, and my programmings not that great,
  17. only been doing it less than a year, and it's just me and the books, so
  18. don't expect much)
  19.  
  20. My code: }
  21.  
  22. Program Simple_DOS_Window;
  23.  
  24. {$M $8000, 0, 16384}  { Not sure if we need all that, but hey... }
  25.  
  26. Uses DOS, CRT;
  27.  
  28. VAR
  29.  
  30.   P1, P2 : Pointer;  {these may not get used}
  31.  
  32. {$F+}
  33.  
  34.   Procedure Intercept_Int29(F, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES,
  35.                             BP : Word); Interrupt;
  36.  
  37.     Begin
  38.  
  39.       Write(chr(AX));
  40.  
  41.     end;
  42.  
  43.   {$F+}
  44.  
  45.   Begin
  46.  
  47.     GetIntVec($29, P1); {Remember that other interrupt}
  48.     TextColor(14);
  49.     TextBackground(1);
  50.     Window(10, 5, 70, 15);
  51.     CLRSCR;  {make a nice blue window on the screen}
  52.     SetIntVec($29, Addr(Intercept_Int29)); {Set up our own interrupt}
  53.     Exec(GetEnv('COMSPEC'), ''); {run DOS in our window}
  54.     SetIntVec($29, P1); {Restore that old interrupt}
  55.  
  56.  end.